$$.setConfig($$CONFIG);
window.weui = require('../plugin/weui');
$$.foot = require('../component/foot/foot');
$$.fn = require('./function');
$$.methods.$401 = function () {
    sessionStorage.clear();
    $$.sessionStore('url', window.location.href);
    $$.redirect($$.c.host + '/kaoqin/open/oauth.json?host=' + location.host, 'replace');
};
$$.methods.$400 = function (ret) {
    weui.loading().hide();
    weui.alert(ret.msg);
};
$$.methods.$4001 = function (ret) {
    weui.loading().hide();
    weui.alert(ret.msg, function () {
        location.reload();
    });
};

$$.methods.page_start = function () {
    weui.loading('Loading');
};
$$.methods.page_error = function (e) {
    weui.alert(JSON.stringify(e));
};
weui.loading('Loading');
document.addEventListener('touchstart', function () {

});
$$.methods.page_end = function (state) {
    state.title && $$.fn.set_wx_title(state.title);
};